﻿using Prism.Mvvm;

namespace PLCSharp.CoreModel.Common
{

    public enum CellState
    {
        无料 = 0,
        有料 = 1,
        待加工 = 2,
        已完成 = 3,
        已拍照 = 4,
        OK = 100,
        NG = 101
    }

    public class CellInfo : BindableBase
    {

        private int _Index;
        /// <summary>
        /// Comment
        /// </summary>
        public int Index
        {
            get { return _Index; }
            set { SetProperty(ref _Index, value); }
        }

        private int _Row;
        /// <summary>
        /// Comment
        /// </summary>
        public int Row
        {
            get { return _Row; }
            set { SetProperty(ref _Row, value); }
        }

        private int _Column;
        /// <summary>
        /// Comment
        /// </summary>
        public int Column
        {
            get { return _Column; }
            set { SetProperty(ref _Column, value); }
        }

        private CellState _State;
        /// <summary>
        /// Comment
        /// </summary>
        public CellState State
        {
            get { return _State; }
            set
            {
                SetProperty(ref _State, value);

                _CellChanged?.Invoke(this, _State);
            }
        }

        private string _Info;
        /// <summary>
        /// Comment
        /// </summary>
        public string Info
        {
            get { return _Info; }
            set { SetProperty(ref _Info, value); }
        }

        public event EventHandler<CellState> _CellChanged;


    }
}
